-- GENERATED SPELL FOR [Shadowed Spirit] --


function spell0_14511(pUnit, Event) --@Shadow Bolt,n/a--
pUnit:FullCastSpellOnTarget(12739,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_14511', 3000, 1)
end

function spell1_14511(pUnit, Event) --@Shadow Bolt Volley,n/a--
pUnit:FullCastSpellOnTarget(15245,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_14511', 3000, 1)
end

function spell2_14511(pUnit, Event) --@Shadow Shield,n/a--
pUnit:FullCastSpellOnTarget(22417,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_14511', 30275, 1)
end

function spell3_14511(pUnit, Event) --@Shadow Shock,n/a--
pUnit:FullCastSpellOnTarget(22575,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_14511', 606, 1)
end

function Sorts_14511(pUnit, Event)
local choix_sorts_14511 = math.random(0, 3)
if choix_sorts_14511 == 0 then
pUnit:RegisterEvent('spell0_14511', 1, 1)
end
if choix_sorts_14511 == 1 then
pUnit:RegisterEvent('spell1_14511', 1, 1)
end
if choix_sorts_14511 == 2 then
pUnit:RegisterEvent('spell2_14511', 1, 1)
end
if choix_sorts_14511 == 3 then
pUnit:RegisterEvent('spell3_14511', 1, 1)
end
end

function mob14511_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_14511', math.random(1500, 3000), 1)
end

function mob14511_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob14511_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob14511_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(14511, 1, 'mob14511_Action')
RegisterUnitEvent(14511, 2, 'mob14511_Leave')
RegisterUnitEvent(14511, 3, 'mob14511_Kill')
RegisterUnitEvent(14511, 4, 'mob14511_Die')
